<!DOCTYPE html>
<html lang=zh>
<head><meta name="generator" content="Hexo 3.9.0">
    <!-- so meta -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="HandheldFriendly" content="True">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="description" content="前言运营平台的后台需要画几个关于统计的图表，看了下晚上的方案，最好的就是highcharts和echarts，听闻别人讲echarts体积还是有点大，不如highcharts来得轻巧，外加之前自己也使用过highcharts，对于它超级细化的配置还是印象很深刻的，所以最终决定使用highcharts来实现我的功能。可是之前都没有总结，再次使用起highcharts依旧需要翻看API文档，这篇文章重">
<meta name="keywords" content="同花顺,highcharts">
<meta property="og:type" content="article">
<meta property="og:title" content="使用highcharts的一些心得">
<meta property="og:url" content="https://andyliwr.github.io/2019/05/05/highcharts_record/index.html">
<meta property="og:site_name" content="月光倾城的代码小屋">
<meta property="og:description" content="前言运营平台的后台需要画几个关于统计的图表，看了下晚上的方案，最好的就是highcharts和echarts，听闻别人讲echarts体积还是有点大，不如highcharts来得轻巧，外加之前自己也使用过highcharts，对于它超级细化的配置还是印象很深刻的，所以最终决定使用highcharts来实现我的功能。可是之前都没有总结，再次使用起highcharts依旧需要翻看API文档，这篇文章重">
<meta property="og:locale" content="zh-CN">
<meta property="og:image" content="https://img.vim-cn.com/a5/165eb2ff596acadc27c34b748b6281253cde22.png">
<meta property="og:updated_time" content="2019-05-05T10:15:06.000Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="使用highcharts的一些心得">
<meta name="twitter:description" content="前言运营平台的后台需要画几个关于统计的图表，看了下晚上的方案，最好的就是highcharts和echarts，听闻别人讲echarts体积还是有点大，不如highcharts来得轻巧，外加之前自己也使用过highcharts，对于它超级细化的配置还是印象很深刻的，所以最终决定使用highcharts来实现我的功能。可是之前都没有总结，再次使用起highcharts依旧需要翻看API文档，这篇文章重">
<meta name="twitter:image" content="https://img.vim-cn.com/a5/165eb2ff596acadc27c34b748b6281253cde22.png">
    
    
        
          
              <link rel="shortcut icon" href="/images/favicon.ico">
          
        
        
          
            <link rel="icon" type="image/png" href="/images/favicon-192x192.png" sizes="192x192">
          
        
        
          
            <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon.png">
          
        
    
    <!-- title -->
    <title>使用highcharts的一些心得</title>
    <!-- styles -->
    <link rel="stylesheet" href="/css/style.css">
    <!-- persian styles -->
    
      <link rel="stylesheet" href="/css/rtl.css">
    
    <!-- rss -->
    
    
</head>

<body class="max-width mx-auto px3 ltr">
    
      <div id="header-post">
  <a id="menu-icon" href="#"><i class="fas fa-bars fa-lg"></i></a>
  <a id="menu-icon-tablet" href="#"><i class="fas fa-bars fa-lg"></i></a>
  <a id="top-icon-tablet" href="#" onclick="$('html, body').animate({ scrollTop: 0 }, 'fast');" style="display:none;"><i class="fas fa-chevron-up fa-lg"></i></a>
  <span id="menu">
    <span id="nav">
      <ul>
         
          <li><a href="/">首页</a></li>
         
          <li><a href="/archives/">归档</a></li>
         
          <li><a href="/search/">搜索</a></li>
         
          <li><a href="/tags/">标签</a></li>
         
          <li><a href="/others/">其他文章</a></li>
        
      </ul>
    </span>
    <br/>
    <span id="actions">
      <ul>
        
        <li><a class="icon" href="/2019/07/22/youzan_working/"><i class="fas fa-chevron-left" aria-hidden="true" onmouseover="$('#i-prev').toggle();" onmouseout="$('#i-prev').toggle();"></i></a></li>
        
        
        <li><a class="icon" href="/2019/03/28/indexeddb_instroduce/"><i class="fas fa-chevron-right" aria-hidden="true" onmouseover="$('#i-next').toggle();" onmouseout="$('#i-next').toggle();"></i></a></li>
        
        <li><a class="icon" href="#" onclick="$('html, body').animate({ scrollTop: 0 }, 'fast');"><i class="fas fa-chevron-up" aria-hidden="true" onmouseover="$('#i-top').toggle();" onmouseout="$('#i-top').toggle();"></i></a></li>
        <li><a class="icon" href="#"><i class="fas fa-share-alt" aria-hidden="true" onmouseover="$('#i-share').toggle();" onmouseout="$('#i-share').toggle();" onclick="$('#share').toggle();return false;"></i></a></li>
      </ul>
      <span id="i-prev" class="info" style="display:none;">上一篇</span>
      <span id="i-next" class="info" style="display:none;">下一篇</span>
      <span id="i-top" class="info" style="display:none;">返回顶部</span>
      <span id="i-share" class="info" style="display:none;">分享文章</span>
    </span>
    <br/>
    <div id="share" style="display: none">
      <ul>
  <li><a class="icon" href="http://www.facebook.com/sharer.php?u=https://andyliwr.github.io/2019/05/05/highcharts_record/"><i class="fab fa-facebook " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://twitter.com/share?url=https://andyliwr.github.io/2019/05/05/highcharts_record/&text=使用highcharts的一些心得"><i class="fab fa-twitter " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://www.linkedin.com/shareArticle?url=https://andyliwr.github.io/2019/05/05/highcharts_record/&title=使用highcharts的一些心得"><i class="fab fa-linkedin " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://pinterest.com/pin/create/bookmarklet/?url=https://andyliwr.github.io/2019/05/05/highcharts_record/&is_video=false&description=使用highcharts的一些心得"><i class="fab fa-pinterest " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="mailto:?subject=使用highcharts的一些心得&body=Check out this article: https://andyliwr.github.io/2019/05/05/highcharts_record/"><i class="fas fa-envelope " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://getpocket.com/save?url=https://andyliwr.github.io/2019/05/05/highcharts_record/&title=使用highcharts的一些心得"><i class="fab fa-get-pocket " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://reddit.com/submit?url=https://andyliwr.github.io/2019/05/05/highcharts_record/&title=使用highcharts的一些心得"><i class="fab fa-reddit " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://www.stumbleupon.com/submit?url=https://andyliwr.github.io/2019/05/05/highcharts_record/&title=使用highcharts的一些心得"><i class="fab fa-stumbleupon " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://digg.com/submit?url=https://andyliwr.github.io/2019/05/05/highcharts_record/&title=使用highcharts的一些心得"><i class="fab fa-digg " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://www.tumblr.com/share/link?url=https://andyliwr.github.io/2019/05/05/highcharts_record/&name=使用highcharts的一些心得&description="><i class="fab fa-tumblr " aria-hidden="true"></i></a></li>
</ul>

    </div>
    <div id="toc">
      <ol class="toc"><li class="toc-item toc-level-3"><a class="toc-link" href="#前言"><span class="toc-number">1.</span> <span class="toc-text">前言</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#资源网站"><span class="toc-number">2.</span> <span class="toc-text">资源网站</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#折线图"><span class="toc-number">3.</span> <span class="toc-text">折线图</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#结束"><span class="toc-number">4.</span> <span class="toc-text">结束</span></a></li></ol>
    </div>
  </span>
</div>

    
    <div class="content index py4">
        
        <article class="post" itemscope itemtype="http://schema.org/BlogPosting">
  <header>
    
    <h1 class="posttitle" itemprop="name headline">
        使用highcharts的一些心得
    </h1>



    <div class="meta">
      <span class="author" itemprop="author" itemscope itemtype="http://schema.org/Person">
        <span itemprop="name">月光倾城的代码小屋</span>
      </span>
      
    <div class="postdate">
        <time datetime="2019-05-05T10:15:06.000Z" itemprop="datePublished">2019-05-05</time>
    </div>


      

      
    <div class="article-tag">
        <i class="fas fa-tag"></i>
        <a class="tag-link" href="/tags/highcharts/">highcharts</a>, <a class="tag-link" href="/tags/同花顺/">同花顺</a>
    </div>


    </div>
  </header>
  
<div class="article-gallery">
    
    <a class="gallery-item" href="https://img.vim-cn.com/a5/165eb2ff596acadc27c34b748b6281253cde22.png" rel="gallery_ck5exevqa000vayojgbyrv9vq">
        <img src="https://img.vim-cn.com/a5/165eb2ff596acadc27c34b748b6281253cde22.png" itemprop="image" />
    </a>
    
</div>


  <div class="content" itemprop="articleBody">
    <h3 id="前言"><a href="#前言" class="headerlink" title="前言"></a>前言</h3><p>运营平台的后台需要画几个关于统计的图表，看了下晚上的方案，最好的就是<code>highcharts</code>和<code>echarts</code>，听闻别人讲<code>echarts</code>体积还是有点大，不如<code>highcharts</code>来得轻巧，外加之前自己也使用<code>过highcharts</code>，对于它超级细化的配置还是印象很深刻的，所以最终决定使用<code>highcharts</code>来实现我的功能。可是之前都没有总结，再次使用起<code>highcharts</code>依旧需要翻看API文档，这篇文章重点不在于详细介绍<code>highcharts</code>每个配置的含义，而是讲解使用<code>highcharts</code>可以从什么地方快速获取资源。</p>
<h3 id="资源网站"><a href="#资源网站" class="headerlink" title="资源网站"></a>资源网站</h3><ul>
<li><a href="https://api.highcharts.com/highcharts/" target="_blank" rel="noopener">highcharts API文档</a></li>
<li><a href="https://www.highcharts.com/demo" target="_blank" rel="noopener">highcharts 常见demo</a></li>
<li><a href="https://www.highcharts.com.cn/mapdata" target="_blank" rel="noopener">highcharts地图数据</a></li>
</ul>
<h3 id="折线图"><a href="#折线图" class="headerlink" title="折线图"></a>折线图</h3><p>使用highcharts画折线图，核心在于定义好options的series和xAxis，<br><figure class="highlight js"><figcaption><span>option.js</span></figcaption><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br><span class="line">135</span><br><span class="line">136</span><br><span class="line">137</span><br><span class="line">138</span><br><span class="line">139</span><br><span class="line">140</span><br><span class="line">141</span><br><span class="line">142</span><br><span class="line">143</span><br><span class="line">144</span><br><span class="line">145</span><br><span class="line">146</span><br><span class="line">147</span><br><span class="line">148</span><br><span class="line">149</span><br><span class="line">150</span><br><span class="line">151</span><br><span class="line">152</span><br><span class="line">153</span><br><span class="line">154</span><br><span class="line">155</span><br><span class="line">156</span><br><span class="line">157</span><br><span class="line">158</span><br><span class="line">159</span><br><span class="line">160</span><br><span class="line">161</span><br><span class="line">162</span><br><span class="line">163</span><br><span class="line">164</span><br><span class="line">165</span><br><span class="line">166</span><br><span class="line">167</span><br><span class="line">168</span><br><span class="line">169</span><br><span class="line">170</span><br><span class="line">171</span><br><span class="line">172</span><br><span class="line">173</span><br><span class="line">174</span><br><span class="line">175</span><br><span class="line">176</span><br><span class="line">177</span><br><span class="line">178</span><br><span class="line">179</span><br><span class="line">180</span><br><span class="line">181</span><br><span class="line">182</span><br><span class="line">183</span><br><span class="line">184</span><br><span class="line">185</span><br><span class="line">186</span><br><span class="line">187</span><br><span class="line">188</span><br><span class="line">189</span><br><span class="line">190</span><br><span class="line">191</span><br><span class="line">192</span><br><span class="line">193</span><br><span class="line">194</span><br><span class="line">195</span><br><span class="line">196</span><br><span class="line">197</span><br><span class="line">198</span><br><span class="line">199</span><br><span class="line">200</span><br><span class="line">201</span><br><span class="line">202</span><br><span class="line">203</span><br><span class="line">204</span><br><span class="line">205</span><br><span class="line">206</span><br><span class="line">207</span><br><span class="line">208</span><br><span class="line">209</span><br><span class="line">210</span><br><span class="line">211</span><br><span class="line">212</span><br><span class="line">213</span><br><span class="line">214</span><br><span class="line">215</span><br><span class="line">216</span><br><span class="line">217</span><br><span class="line">218</span><br><span class="line">219</span><br><span class="line">220</span><br><span class="line">221</span><br><span class="line">222</span><br><span class="line">223</span><br><span class="line">224</span><br><span class="line">225</span><br><span class="line">226</span><br><span class="line">227</span><br><span class="line">228</span><br><span class="line">229</span><br><span class="line">230</span><br><span class="line">231</span><br><span class="line">232</span><br><span class="line">233</span><br><span class="line">234</span><br><span class="line">235</span><br><span class="line">236</span><br><span class="line">237</span><br><span class="line">238</span><br><span class="line">239</span><br><span class="line">240</span><br><span class="line">241</span><br><span class="line">242</span><br><span class="line">243</span><br><span class="line">244</span><br><span class="line">245</span><br><span class="line">246</span><br><span class="line">247</span><br><span class="line">248</span><br><span class="line">249</span><br><span class="line">250</span><br><span class="line">251</span><br><span class="line">252</span><br><span class="line">253</span><br><span class="line">254</span><br><span class="line">255</span><br><span class="line">256</span><br><span class="line">257</span><br><span class="line">258</span><br><span class="line">259</span><br><span class="line">260</span><br><span class="line">261</span><br><span class="line">262</span><br><span class="line">263</span><br><span class="line">264</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">import</span> moment <span class="keyword">from</span> <span class="string">'moment'</span>;</span><br><span class="line"></span><br><span class="line"><span class="keyword">const</span> hours = [</span><br><span class="line">  <span class="string">'00:00'</span>,</span><br><span class="line">  <span class="string">'00:30'</span>,</span><br><span class="line">  <span class="string">'01:00'</span>,</span><br><span class="line">  <span class="string">'01:30'</span>,</span><br><span class="line">  <span class="string">'02:00'</span>,</span><br><span class="line">  <span class="string">'02:30'</span>,</span><br><span class="line">  <span class="string">'03:00'</span>,</span><br><span class="line">  <span class="string">'03:30'</span>,</span><br><span class="line">  <span class="string">'04:00'</span>,</span><br><span class="line">  <span class="string">'04:30'</span>,</span><br><span class="line">  <span class="string">'05:00'</span>,</span><br><span class="line">  <span class="string">'05:30'</span>,</span><br><span class="line">  <span class="string">'06:00'</span>,</span><br><span class="line">  <span class="string">'06:30'</span>,</span><br><span class="line">  <span class="string">'07:00'</span>,</span><br><span class="line">  <span class="string">'07:30'</span>,</span><br><span class="line">  <span class="string">'08:00'</span>,</span><br><span class="line">  <span class="string">'08:30'</span>,</span><br><span class="line">  <span class="string">'09:00'</span>,</span><br><span class="line">  <span class="string">'09:30'</span>,</span><br><span class="line">  <span class="string">'10:00'</span>,</span><br><span class="line">  <span class="string">'10:30'</span>,</span><br><span class="line">  <span class="string">'11:00'</span>,</span><br><span class="line">  <span class="string">'11:30'</span>,</span><br><span class="line">  <span class="string">'12:00'</span>,</span><br><span class="line">  <span class="string">'12:30'</span>,</span><br><span class="line">  <span class="string">'13:00'</span>,</span><br><span class="line">  <span class="string">'13:30'</span>,</span><br><span class="line">  <span class="string">'14:00'</span>,</span><br><span class="line">  <span class="string">'14:30'</span>,</span><br><span class="line">  <span class="string">'15:00'</span>,</span><br><span class="line">  <span class="string">'15:30'</span>,</span><br><span class="line">  <span class="string">'16:00'</span>,</span><br><span class="line">  <span class="string">'16:30'</span>,</span><br><span class="line">  <span class="string">'17:00'</span>,</span><br><span class="line">  <span class="string">'17:30'</span>,</span><br><span class="line">  <span class="string">'18:00'</span>,</span><br><span class="line">  <span class="string">'18:30'</span>,</span><br><span class="line">  <span class="string">'19:00'</span>,</span><br><span class="line">  <span class="string">'19:30'</span>,</span><br><span class="line">  <span class="string">'20:00'</span>,</span><br><span class="line">  <span class="string">'20:30'</span>,</span><br><span class="line">  <span class="string">'21:00'</span>,</span><br><span class="line">  <span class="string">'21:30'</span>,</span><br><span class="line">  <span class="string">'22:00'</span>,</span><br><span class="line">  <span class="string">'22:30'</span>,</span><br><span class="line">  <span class="string">'23:00'</span>,</span><br><span class="line">  <span class="string">'23:30'</span>,</span><br><span class="line">  <span class="string">'24:00'</span>,</span><br><span class="line">];</span><br><span class="line"><span class="keyword">const</span> prefix = moment().format(<span class="string">'YYYY-MM-DD'</span>);</span><br><span class="line"></span><br><span class="line"><span class="keyword">export</span> <span class="keyword">default</span> &#123;</span><br><span class="line">  chart: &#123;</span><br><span class="line">    scrollablePlotArea: &#123;</span><br><span class="line">      minWidth: <span class="number">700</span>,</span><br><span class="line">    &#125;,</span><br><span class="line">  &#125;,</span><br><span class="line"></span><br><span class="line">  title: &#123;</span><br><span class="line">    text: <span class="string">''</span>,</span><br><span class="line">  &#125;,</span><br><span class="line"></span><br><span class="line">  subtitle: &#123;</span><br><span class="line">    text: <span class="string">''</span>,</span><br><span class="line">  &#125;,</span><br><span class="line"></span><br><span class="line">  xAxis: &#123;</span><br><span class="line">    type: <span class="string">'datetime'</span>,</span><br><span class="line">    labels: &#123;</span><br><span class="line">      align: <span class="string">'left'</span>,</span><br><span class="line">      x: <span class="number">3</span>,</span><br><span class="line">      y: <span class="number">-3</span>,</span><br><span class="line">      formatter() &#123;</span><br><span class="line">        <span class="keyword">return</span> <span class="keyword">this</span>.value &amp;&amp; <span class="keyword">this</span>.value.split(<span class="string">' '</span>).length &gt; <span class="number">1</span> ? <span class="keyword">this</span>.value.split(<span class="string">' '</span>)[<span class="number">1</span>] : <span class="string">'未知时间'</span>;</span><br><span class="line">      &#125;,</span><br><span class="line">      style: &#123; <span class="attr">position</span>: <span class="string">'relative'</span>, <span class="attr">top</span>: <span class="string">'10px'</span> &#125;,</span><br><span class="line">    &#125;,</span><br><span class="line">    title: &#123;</span><br><span class="line">      text: <span class="string">'时间段'</span>,</span><br><span class="line">      style: &#123;</span><br><span class="line">        color: <span class="string">'#666666'</span>,</span><br><span class="line">        fontSize: <span class="string">'12px'</span>,</span><br><span class="line">        fontWeight: <span class="string">'normal'</span>,</span><br><span class="line">        fontStyle: <span class="string">'normal'</span>,</span><br><span class="line">      &#125;,</span><br><span class="line">    &#125;,</span><br><span class="line">    className: <span class="string">'x-axis'</span>,</span><br><span class="line">    categories: hours.map(<span class="function"><span class="params">item</span> =&gt;</span> <span class="string">`<span class="subst">$&#123;prefix&#125;</span> <span class="subst">$&#123;item&#125;</span>`</span>),</span><br><span class="line">  &#125;,</span><br><span class="line"></span><br><span class="line">  yAxis: [</span><br><span class="line">    &#123;</span><br><span class="line">      title: &#123;</span><br><span class="line">        text: <span class="literal">null</span>,</span><br><span class="line">      &#125;,</span><br><span class="line">      labels: &#123;</span><br><span class="line">        align: <span class="string">'left'</span>,</span><br><span class="line">        x: <span class="number">3</span>,</span><br><span class="line">        y: <span class="number">16</span>,</span><br><span class="line">        format: <span class="string">'&#123;value:.,0f&#125;'</span>,</span><br><span class="line">      &#125;,</span><br><span class="line">      showFirstLabel: <span class="literal">false</span>,</span><br><span class="line">      index: <span class="number">0</span>,</span><br><span class="line">    &#125;,</span><br><span class="line">  ],</span><br><span class="line"></span><br><span class="line">  legend: &#123;</span><br><span class="line">    align: <span class="string">'center'</span>,</span><br><span class="line">    verticalAlign: <span class="string">'top'</span>,</span><br><span class="line">    borderWidth: <span class="number">0</span>,</span><br><span class="line">  &#125;,</span><br><span class="line"></span><br><span class="line">  tooltip: &#123;</span><br><span class="line">    shared: <span class="literal">true</span>,</span><br><span class="line">    crosshairs: [<span class="literal">true</span>, <span class="literal">true</span>],</span><br><span class="line">    backgroundColor: <span class="string">'#ffffff'</span>,</span><br><span class="line">    borderWidth: <span class="number">0</span>,</span><br><span class="line">    borderRaduis: <span class="number">4</span>,</span><br><span class="line">    shadow: <span class="literal">true</span>,</span><br><span class="line">    useHTML: <span class="literal">true</span>,</span><br><span class="line">    formatter() &#123;</span><br><span class="line">      <span class="keyword">let</span> content = <span class="string">`&lt;p&gt;<span class="subst">$&#123;<span class="keyword">this</span>.x &amp;&amp; <span class="keyword">this</span>.x.split(<span class="string">' '</span>).length &gt; <span class="number">1</span> ? <span class="keyword">this</span>.x.split(<span class="string">' '</span>)[<span class="number">1</span>] : <span class="string">'未知时间'</span>&#125;</span>&lt;/p&gt;`</span>;</span><br><span class="line">      <span class="keyword">const</span> names = [<span class="string">'新增用户数'</span>, <span class="string">'浏览用户数'</span>, <span class="string">'浏览次数'</span>];</span><br><span class="line">      <span class="keyword">this</span>.points.forEach(<span class="function">(<span class="params">item, index</span>) =&gt;</span> &#123;</span><br><span class="line">        <span class="keyword">const</span> name = names[index];</span><br><span class="line">        content += <span class="string">`&lt;p style="overflow: hidden; width: 168px; line-height: 1.6em; padding: 0; margin: 0"&gt;&lt;span style="float: left"&gt;&lt;span style="display: inline-block; width: 6px; height: 6px; border-radius: 3px; background: <span class="subst">$&#123;</span></span></span><br><span class="line"><span class="string"><span class="subst">          item.color</span></span></span><br><span class="line"><span class="string"><span class="subst">        &#125;</span>; margin-right: 8px; vertical-align: middle"&gt;&lt;/span&gt;<span class="subst">$&#123;name&#125;</span>&lt;/span&gt;&lt;span style="float: right"&gt;<span class="subst">$&#123;item.y.toLocaleString(</span></span></span><br><span class="line"><span class="string"><span class="subst">          <span class="string">'en-US'</span></span></span></span><br><span class="line"><span class="string"><span class="subst">        )&#125;</span>&lt;/span&gt;&lt;/p&gt;`</span>;</span><br><span class="line">      &#125;);</span><br><span class="line">      <span class="keyword">return</span> content;</span><br><span class="line">    &#125;,</span><br><span class="line">  &#125;,</span><br><span class="line"></span><br><span class="line">  plotOptions: &#123;</span><br><span class="line">    series: &#123;</span><br><span class="line">      cursor: <span class="string">'pointer'</span>,</span><br><span class="line">      marker: &#123;</span><br><span class="line">        lineWidth: <span class="number">1</span>,</span><br><span class="line">      &#125;,</span><br><span class="line">      animation: <span class="literal">false</span>,</span><br><span class="line">      dataLabels: &#123;</span><br><span class="line">        enabled: <span class="literal">true</span>,</span><br><span class="line">        format: <span class="string">'&#123;point.label&#125;'</span>,</span><br><span class="line">      &#125;,</span><br><span class="line">      states: &#123;</span><br><span class="line">        inactive: &#123;&#125;,</span><br><span class="line">      &#125;,</span><br><span class="line">    &#125;,</span><br><span class="line">  &#125;,</span><br><span class="line"></span><br><span class="line">  series: [</span><br><span class="line">    &#123;</span><br><span class="line">      name: <span class="string">'新增用户数'</span>,</span><br><span class="line">      turboThreshold: <span class="number">0</span>,</span><br><span class="line">      _colorIndex: <span class="number">0</span>,</span><br><span class="line">      _symbolIndex: <span class="number">0</span>,</span><br><span class="line">      lineWidth: <span class="number">1</span>,</span><br><span class="line">      dashStyle: <span class="string">'Solid'</span>,</span><br><span class="line">      color: <span class="string">'#1890ff'</span>,</span><br><span class="line">      data: [</span><br><span class="line">        <span class="number">43934</span>,</span><br><span class="line">        <span class="number">52503</span>,</span><br><span class="line">        <span class="number">57177</span>,</span><br><span class="line">        <span class="number">69658</span>,</span><br><span class="line">        <span class="number">97031</span>,</span><br><span class="line">        <span class="number">119931</span>,</span><br><span class="line">        <span class="number">137133</span>,</span><br><span class="line">        <span class="number">154175</span>,</span><br><span class="line">        <span class="number">43934</span>,</span><br><span class="line">        <span class="number">52503</span>,</span><br><span class="line">        <span class="number">57177</span>,</span><br><span class="line">        <span class="number">69658</span>,</span><br><span class="line">        <span class="number">97031</span>,</span><br><span class="line">        <span class="number">119931</span>,</span><br><span class="line">        <span class="number">137133</span>,</span><br><span class="line">        <span class="number">154175</span>,</span><br><span class="line">        <span class="number">43934</span>,</span><br><span class="line">        <span class="number">52503</span>,</span><br><span class="line">        <span class="number">57177</span>,</span><br><span class="line">        <span class="number">69658</span>,</span><br><span class="line">        <span class="number">97031</span>,</span><br><span class="line">        <span class="number">119931</span>,</span><br><span class="line">        <span class="number">137133</span>,</span><br><span class="line">        <span class="number">154175</span>,</span><br><span class="line">      ],</span><br><span class="line">    &#125;,</span><br><span class="line">    &#123;</span><br><span class="line">      name: <span class="string">'浏览用户数'</span>,</span><br><span class="line">      turboThreshold: <span class="number">0</span>,</span><br><span class="line">      _colorIndex: <span class="number">1</span>,</span><br><span class="line">      _symbolIndex: <span class="number">0</span>,</span><br><span class="line">      lineWidth: <span class="number">1</span>,</span><br><span class="line">      color: <span class="string">'#faad14'</span>,</span><br><span class="line">      data: [</span><br><span class="line">        <span class="number">24916</span>,</span><br><span class="line">        <span class="number">24064</span>,</span><br><span class="line">        <span class="number">29742</span>,</span><br><span class="line">        <span class="number">29851</span>,</span><br><span class="line">        <span class="number">32490</span>,</span><br><span class="line">        <span class="number">30282</span>,</span><br><span class="line">        <span class="number">38121</span>,</span><br><span class="line">        <span class="number">40434</span>,</span><br><span class="line">        <span class="number">24916</span>,</span><br><span class="line">        <span class="number">24064</span>,</span><br><span class="line">        <span class="number">29742</span>,</span><br><span class="line">        <span class="number">29851</span>,</span><br><span class="line">        <span class="number">32490</span>,</span><br><span class="line">        <span class="number">30282</span>,</span><br><span class="line">        <span class="number">38121</span>,</span><br><span class="line">        <span class="number">40434</span>,</span><br><span class="line">        <span class="number">24916</span>,</span><br><span class="line">        <span class="number">24064</span>,</span><br><span class="line">        <span class="number">29742</span>,</span><br><span class="line">        <span class="number">29851</span>,</span><br><span class="line">        <span class="number">32490</span>,</span><br><span class="line">        <span class="number">30282</span>,</span><br><span class="line">        <span class="number">38121</span>,</span><br><span class="line">        <span class="number">40434</span>,</span><br><span class="line">      ],</span><br><span class="line">    &#125;,</span><br><span class="line">    &#123;</span><br><span class="line">      name: <span class="string">'浏览次数'</span>,</span><br><span class="line">      turboThreshold: <span class="number">0</span>,</span><br><span class="line">      _colorIndex: <span class="number">2</span>,</span><br><span class="line">      _symbolIndex: <span class="number">0</span>,</span><br><span class="line">      lineWidth: <span class="number">1</span>,</span><br><span class="line">      color: <span class="string">'#52c41a'</span>,</span><br><span class="line">      data: [</span><br><span class="line">        <span class="literal">null</span>,</span><br><span class="line">        <span class="literal">null</span>,</span><br><span class="line">        <span class="number">7988</span>,</span><br><span class="line">        <span class="number">12169</span>,</span><br><span class="line">        <span class="number">15112</span>,</span><br><span class="line">        <span class="number">22452</span>,</span><br><span class="line">        <span class="number">34400</span>,</span><br><span class="line">        <span class="number">34227</span>,</span><br><span class="line">        <span class="number">7988</span>,</span><br><span class="line">        <span class="number">12169</span>,</span><br><span class="line">        <span class="number">15112</span>,</span><br><span class="line">        <span class="number">22452</span>,</span><br><span class="line">        <span class="number">34400</span>,</span><br><span class="line">        <span class="number">34227</span>,</span><br><span class="line">        <span class="number">7988</span>,</span><br><span class="line">        <span class="number">12169</span>,</span><br><span class="line">        <span class="number">15112</span>,</span><br><span class="line">        <span class="number">22452</span>,</span><br><span class="line">        <span class="number">34400</span>,</span><br><span class="line">        <span class="number">34227</span>,</span><br><span class="line">        <span class="number">7988</span>,</span><br><span class="line">        <span class="number">12169</span>,</span><br><span class="line">        <span class="number">15112</span>,</span><br><span class="line">        <span class="number">22452</span>,</span><br><span class="line">        <span class="number">34400</span>,</span><br><span class="line">        <span class="number">34227</span>,</span><br><span class="line">      ],</span><br><span class="line">    &#125;,</span><br><span class="line">  ],</span><br><span class="line">&#125;;</span><br></pre></td></tr></table></figure></p>
<h3 id="结束"><a href="#结束" class="headerlink" title="结束"></a>结束</h3><p>如果你有更好的建议或者困惑的地方，都可以发送邮件到我的邮箱 - <a href="andyliwr@outlook.com">andyliwr@outlook.com</a></p>

  </div>
  <div class="statement">
    <hr>  
    1. 如果本文帮到了您，不妨点一下右上角的”<i class="fas fa-share-alt"></i>“按钮。<br>
    2. 除非注明，本博文章均为原创，转载请以链接形式标明本文地址。<br>
    3. 如果你有任何疑问，欢迎发送邮件到我的邮箱<a href="mailto:andyliwr@outlook.com">andyliwr@outlook.com<br>
  </div>
</article>


    <div class="blog-post-comments">
        <div id="gitalk_thread">
            <noscript>加载评论需要在浏览器启用 JavaScript 脚本支持。</noscript>
        </div>
    </div>



        
          <div id="footer-post-container">
  <div id="footer-post">

    <div id="nav-footer" style="display: none">
      <ul>
         
          <li><a href="/">首页</a></li>
         
          <li><a href="/archives/">归档</a></li>
         
          <li><a href="/search/">搜索</a></li>
         
          <li><a href="/tags/">标签</a></li>
         
          <li><a href="/others/">其他文章</a></li>
        
      </ul>
    </div>

    <div id="toc-footer" style="display: none">
      <ol class="toc"><li class="toc-item toc-level-3"><a class="toc-link" href="#前言"><span class="toc-number">1.</span> <span class="toc-text">前言</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#资源网站"><span class="toc-number">2.</span> <span class="toc-text">资源网站</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#折线图"><span class="toc-number">3.</span> <span class="toc-text">折线图</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#结束"><span class="toc-number">4.</span> <span class="toc-text">结束</span></a></li></ol>
    </div>

    <div id="share-footer" style="display: none">
      <ul>
  <li><a class="icon" href="http://www.facebook.com/sharer.php?u=https://andyliwr.github.io/2019/05/05/highcharts_record/"><i class="fab fa-facebook fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://twitter.com/share?url=https://andyliwr.github.io/2019/05/05/highcharts_record/&text=使用highcharts的一些心得"><i class="fab fa-twitter fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://www.linkedin.com/shareArticle?url=https://andyliwr.github.io/2019/05/05/highcharts_record/&title=使用highcharts的一些心得"><i class="fab fa-linkedin fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://pinterest.com/pin/create/bookmarklet/?url=https://andyliwr.github.io/2019/05/05/highcharts_record/&is_video=false&description=使用highcharts的一些心得"><i class="fab fa-pinterest fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="mailto:?subject=使用highcharts的一些心得&body=Check out this article: https://andyliwr.github.io/2019/05/05/highcharts_record/"><i class="fas fa-envelope fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://getpocket.com/save?url=https://andyliwr.github.io/2019/05/05/highcharts_record/&title=使用highcharts的一些心得"><i class="fab fa-get-pocket fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://reddit.com/submit?url=https://andyliwr.github.io/2019/05/05/highcharts_record/&title=使用highcharts的一些心得"><i class="fab fa-reddit fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://www.stumbleupon.com/submit?url=https://andyliwr.github.io/2019/05/05/highcharts_record/&title=使用highcharts的一些心得"><i class="fab fa-stumbleupon fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://digg.com/submit?url=https://andyliwr.github.io/2019/05/05/highcharts_record/&title=使用highcharts的一些心得"><i class="fab fa-digg fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://www.tumblr.com/share/link?url=https://andyliwr.github.io/2019/05/05/highcharts_record/&name=使用highcharts的一些心得&description="><i class="fab fa-tumblr fa-lg" aria-hidden="true"></i></a></li>
</ul>

    </div>

    <div id="actions-footer">
        <a id="menu" class="icon" href="#" onclick="$('#nav-footer').toggle();return false;"><i class="fas fa-bars fa-lg" aria-hidden="true"></i> 菜单</a>
        <a id="toc" class="icon" href="#" onclick="$('#toc-footer').toggle();return false;"><i class="fas fa-list fa-lg" aria-hidden="true"></i> 目录</a>
        <a id="share" class="icon" href="#" onclick="$('#share-footer').toggle();return false;"><i class="fas fa-share-alt fa-lg" aria-hidden="true"></i> 分享</a>
        <a id="top" style="display:none" class="icon" href="#" onclick="$('html, body').animate({ scrollTop: 0 }, 'fast');"><i class="fas fa-chevron-up fa-lg" aria-hidden="true"></i> 返回顶部</a>
    </div>

  </div>
</div>

        
        <footer id="footer">
  <div class="footer-left">
    Copyright &copy; 2020 Dikang Li
  </div>
  <div class="footer-right">
    <nav>
      <ul>
         
          <li><a href="/">首页</a></li>
         
          <li><a href="/archives/">归档</a></li>
         
          <li><a href="/search/">搜索</a></li>
         
          <li><a href="/tags/">标签</a></li>
         
          <li><a href="/others/">其他文章</a></li>
        
      </ul>
    </nav>
  </div>
</footer>

    </div>
</body>
</html>
<!-- styles -->
<link rel="stylesheet" href="/lib/font-awesome/css/all.min.css">
<link rel="stylesheet" href="/lib/justified-gallery/css/justifiedGallery.min.css">
<link rel="stylesheet" href="/lib/fancybox/jquery.fancybox.css">

<link rel="stylesheet" href="https://file.lantingshucheng.com/blog/v3/static/styles/gitalk.css">


<!-- jquery -->
<script src="/lib/jquery/jquery.min.js"></script>
<script src="/lib/justified-gallery/js/jquery.justifiedGallery.min.js"></script>
<script src="/lib/fancybox/jquery.fancybox.pack.js"></script>

<script type="text/javascript" src="https://file.lantingshucheng.com/blog/v3/static/scripts/md5.js"></script>
<script type="text/javascript" src="https://file.lantingshucheng.com/blog/v3/static/scripts/gitalk.min.js"></script>

<script src="/js/main.js"></script>
<!-- search -->

<!-- Google Analytics -->

<!-- Baidu Analytics -->

    <script type="text/javascript">
        var _hmt = _hmt || [];
        (function() {
            var hm = document.createElement("script");
            hm.src = "https://hm.baidu.com/hm.js?7851ca7a86be957be994acb77639a5be";
            var s = document.getElementsByTagName("script")[0];
            s.parentNode.insertBefore(hm, s);
        })();
    </script>

<!-- Disqus Comments -->


  <script type="text/javascript">
    window.onload = function(){
      if (window.location.href.indexOf('andyliwr.github.io') > -1) {
        var gitalk = new Gitalk({
          clientID: 'ad6f70df0c70d2b715f9',
          clientSecret: '40384bee244c1e17dd7c37733d21e9ef669e969c',
          repo: 'Andyliwr.github.io',
          owner: 'Andyliwr',
          admin: ['Andyliwr'],
          id: md5(location.pathname),
          distractionFreeMode: 'true'
        })
        gitalk.render('gitalk_thread')
      }
    }
  </script>


